﻿using System.Net;
using System.Text;
using Azure.Online.Proxy.Server;

namespace Azure.Online.Proxy.Actions {
    public class HttpNotFoundResult : ActionResult {
        public override void Execute(HttpServerContext context) {
            context.Response.StatusCode = 404;
            context.Response.StatusDescription = "Storage is not found";

            const string responseHtml = "Storage is not found";
            var responseBytes = Encoding.UTF8.GetBytes(responseHtml);
            context.Response.ContentLength = responseBytes.Length;
            context.Response.OutputStream.Write(responseBytes, 0, responseBytes.Length);
            context.Response.OutputStream.Flush();
            context.Response.OutputStream.Close();
        }
    }
}
